﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Web;

namespace Idte.Application.PDN.Models
{
    public class Category
    {

        [Key]
        [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
        public int Id { get; set; }
        public string Name { get; set; }

        [InverseProperty("Category")]
        public ICollection<CategoryQuestion> CategoryQuestions { get; set; }

        [InverseProperty("Category")]
        public ICollection<CategoryAnswer> CategoryAnswers { get; set; }


          
        public int? CatId { get; set; }
        [ForeignKey("CatId")]   
        public Category Parent { get; set; }
        [InverseProperty("Parent")]
        public ICollection<Category> SubCategories { get; set; }
    }
}